package org.breathe.dynamic.thread.pool.core.context;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 包装CONTEXT, 用ttl维护安全
 * @author: breathe
 * @createTime: 2025-04-10
 */
public class BreatheDtpContextHolder {
    private static final TransmittableThreadLocal<BreatheDtpContext> CONTEXT = new TransmittableThreadLocal<>();
    private BreatheDtpContextHolder() {}
    public static void set(BreatheDtpContext breatheDtpContext) {
        CONTEXT.set(breatheDtpContext);
    }
    public static BreatheDtpContext get() {
        return CONTEXT.get();
    }
    public static void remove() {
        CONTEXT.remove();
    }
}
